
<%@ page import="com.surelution.tinyerp.PurchaseOrder" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'purchaseOrder.label', default: 'PurchaseOrder')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="list" action="list" controller="market"><g:message code="default.marketList.label" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'purchaseOrder.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="orderNo" title="${message(code: 'purchaseOrder.orderNo.label', default: 'OrderNo')}" />

                            <g:sortableColumn property="planNo" title="${message(code: 'purchaseOrder.planNo.label', default: 'PlanNo')}" />
                            
                            <g:sortableColumn property="market" title="${message(code: 'purchaseOrder.market.label', default: 'Market')}" />

                            <g:sortableColumn property="actualFinishTime" title="${message(code: 'purchaseOrder.actualFinishTime.label', default: 'Actual Finish Time')}" />
                        
                            <g:sortableColumn property="assignTime" title="${message(code: 'purchaseOrder.assignTime.label', default: 'Assign Time')}" />
                        
                            <g:sortableColumn property="orderNum" title="${message(code: 'purchaseOrder.orderNum.label', default: 'OrderNum')}" />
                        
                            <g:sortableColumn property="format" title="${message(code: 'purchaseOrder.format.label', default: 'Format')}" />
                        
                            <g:sortableColumn property="prodType" title="${message(code: 'purchaseOrder.prodType.label', default: 'prodType')}" />
                        
                            <g:sortableColumn property="price" title="${message(code: 'purchaseOrder.price.label', default: 'price')}" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${purchaseOrderInstanceList}" status="i" var="purchaseOrderInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${purchaseOrderInstance.id}">${fieldValue(bean: purchaseOrderInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: purchaseOrderInstance, field: "orderNo")}</td>

                            <td>${fieldValue(bean: purchaseOrderInstance, field: "planNo")}</td>
 
                            <td style="width:150px;">${purchaseOrderInstance.market?.name}</td>
                            
                            <td><g:formatDate date="${purchaseOrderInstance.actualFinishTime}" format="yyyy年MM月"/></td>
                        
                            <td><g:formatDate date="${purchaseOrderInstance.assignTime}" format="yyyy年MM月dd日"/></td>
                        
                            <td>${fieldValue(bean: purchaseOrderInstance, field: "orderNum")}</td>
                        
                            <td>${fieldValue(bean: purchaseOrderInstance, field: "format")}</td>
                        
                            <td>${purchaseOrderInstance.prodType.name}</td>

                            <td>${fieldValue(bean: purchaseOrderInstance, field: "price")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${purchaseOrderInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
